package com.headfirst.BehaviorMode.strategy;

import com.headfirst.BehaviorMode.strategy.version2.DecoyDuck;
import com.headfirst.BehaviorMode.strategy.version2.MallardDuck;
import com.headfirst.BehaviorMode.strategy.version2.RedheadDuck;
import com.headfirst.BehaviorMode.strategy.version2.RubberDuck;
import org.junit.Test;

/**
 * @author sunhongguang
 * @create 2022-01-09-21:53
 */
public class DuckTest2 {

    @Test
    public void test2(){
        MallardDuck mallardDuck = new MallardDuck();
        mallardDuck.display();
        mallardDuck.fly();
        mallardDuck.quack();
        mallardDuck.swim();
        System.out.println("-----");

        RedheadDuck redheadDuck = new RedheadDuck();
        redheadDuck.display();
        redheadDuck.fly();
        redheadDuck.quack();
        redheadDuck.swim();
        System.out.println("----");

        RubberDuck rubberDuck = new RubberDuck();
        rubberDuck.display();
        rubberDuck.quack();
        rubberDuck.swim();
        System.out.println("----");

        DecoyDuck decoyDuck = new DecoyDuck();
        decoyDuck.display();
        decoyDuck.swim();
    }
}
